home *** CD-ROM | disk | FTP | other *** search
/ CyberMycha 2005 May / CyberMycha 05-2005 (Poland).bin / Immortal / cotndemo.exe / Data1.cab / combinewithshadowmap.vsh < prev    next >
Encoding:
Text File  |  2004-11-16  |  736 b   |  24 lines

  1. // vertex shader to combine shadow map texture with model drawing to create shadows
  2. // this shader is used when drawing the terrain.
  3.  
  4. vs_1_1                // version
  5. dcl_position v0        // position
  6. dcl_normal v3        // normal
  7. dcl_color v6        // vertex color
  8. dcl_texcoord v7        // texture coordinates
  9.  
  10. m4x4 r0, v0, c0        // transform by matrix at c0 to get position for rendering
  11. mov oPos,r0
  12.  
  13. // oFog = (fogend - dist) / (fogend-fogstart)
  14. sub r1.x,c7.x,r0.w    
  15. mul oFog,r1.x,c7.y    
  16.  
  17. mov oT0,v7            // move the texture coordinate to output
  18.  
  19. mov r0,v3            // v3 isnt really a normal, it's used for shadow buffer projection coordinates
  20. mov oT1,r0            // store in texture coords for stage 1
  21.  
  22.  
  23. mov oD0,v6            // pass the color along to the pixel shader
  24.